package org.kealinghornets.jchuah.buttons;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;


public class Level3Activity extends Level2Activity {

    public void togglebutton(int id) {
        View button = findViewById(id);
        if (button.getVisibility() == View.VISIBLE) {
            button.setVisibility(View.INVISIBLE);
        } else {
            button.setVisibility(View.VISIBLE);
        }
    }
    public void togglestar(int id) {
        View star = findViewById(id);
        if (star.getVisibility() == View.VISIBLE) {
            star.setVisibility(View.INVISIBLE);
        } else {
            star.setVisibility(View.VISIBLE);
        }
    }

    public void onbutton1push (View view){
            toggleVisibility(R.id.button2);
            toggleVisibility(R.id.button3);
            toggleVisibility(R.id.star2);
        }
    public void onbutton3push (View view){
        toggleVisibility(R.id.button2);
        toggleVisibility(R.id.button4);
        toggleVisibility(R.id.button1);
    }
    public void onbutton4push (View view){
        toggleVisibility(R.id.button2);
        toggleVisibility(R.id.star2);
        toggleVisibility(R.id.star4);
    }
    public void onbutton2push (View view){
        toggleVisibility(R.id.star1);

    }
    public void onstar1push(View view){
        toggleVisibility(R.id.star2);
        toggleVisibility(R.id.star4);
        toggleVisibility(R.id.button1);
    }
    public void onstar2push(View view){
        toggleVisibility(R.id.star2);
        toggleVisibility(R.id.star3);
        toggleVisibility(R.id.star4);
    }
    public void onstar3push(View view){
        toggleVisibility(R.id.button2);
        toggleVisibility(R.id.button3);

    }
    public void onstar4push(View view){
        toggleVisibility(R.id.button1);
        toggleVisibility(R.id.star3);
        toggleVisibility(R.id.star4);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_level3);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_level3, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
